import request from '@/utils/request'

// 用户api
export function fetchList(query) {
  return request({
    url: '/admin/students',
    method: 'get',
    params: query
  })
}

export function fetchInfo(id) {
  return request({
    url: `/admin/students/${id}`,
    method: 'get',
    params: { id }
  })
}

export function fetchEdit({ id, ...data }) {
  return request({
    url: `/admin/students/${id}`,
    method: 'put',
    data
  })
}

export function fetchStatus({ id, ...data }) {
  return request({
    url: `/admin/students/${id}`,
    method: 'put',
    data
  })
}

export function fetchDelete(id) {
  return request({
    url: `/admin/students/${id}`,
    method: 'delete'
  })
}

export function fetchDeleteAll(data) {
  return request({
    url: `/admin/students`,
    method: 'delete',
    data
  })
}

export function fetchDownload(data) {
  return request({
    url: `/admin/students/excel`,
    method: 'post',
    data
  })
}
